// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_PUR_APPLICATION
// * CreateDate    : 2012/4/23 20:31:30
// * Creater       : CodeSmith
// * LastChangeDate: 2012/4/23 20:31:30
// * LastChanger   : 2012/4/23 20:31:30
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;

namespace ESOL.Common.Entity
{
    [Serializable]
    public partial class PurApplicationEntity : EntityBase
    {
        public PurApplicationTable TableSchema
        {
            get
            {
                return PurApplicationTable.Current;
            }
        }

        public PurApplicationEntity()
        {

        }

        public PurApplicationEntity(DataRow dr)
        {
            if (dr == null)
            {
                return;
            }
            this.ApplicationId = Convert.ToString(CommonFunctions.ToObject(dr["APPLICATION_ID"]));
            this.PlanOrderId = Convert.ToString(CommonFunctions.ToObject(dr["PLAN_ORDER_ID"]));
            this.ApplicationCode = Convert.ToString(CommonFunctions.ToObject(dr["APPLICATION_CODE"]));
            this.IsProductPurchase = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_PRODUCT_PURCHASE"]));
            this.PurchaseType = Convert.ToString(CommonFunctions.ToObject(dr["PURCHASE_TYPE"]));
            this.ApplicationPerson = Convert.ToString(CommonFunctions.ToObject(dr["APPLICATION_PERSON"]));
            this.ApplicationDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["APPLICATION_DATE"]));
            this.DeliveryRequiredDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["DELIVERY_REQUIRED_DATE"]));
            this.DeliveryPlanDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["DELIVERY_PLAN_DATE"]));
            this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
            this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
            this.CreatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["CREATED_DATE"]));
            this.CreatedBy = Convert.ToString(CommonFunctions.ToObject(dr["CREATED_BY"]));
            this.LastModifiedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["LAST_MODIFIED_DATE"]));
            this.LastModifiedBy = Convert.ToString(CommonFunctions.ToObject(dr["LAST_MODIFIED_BY"]));
            this.ApprovedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["APPROVED_DATE"]));
            this.ApprovedBy = Convert.ToString(CommonFunctions.ToObject(dr["APPROVED_BY"]));
        }

        public PurApplicationEntity(DataRowView dr)
        {
            if (dr == null)
            {
                return;
            }
            this.ApplicationId = Convert.ToString(CommonFunctions.ToObject(dr["APPLICATION_ID"]));
            this.PlanOrderId = Convert.ToString(CommonFunctions.ToObject(dr["PLAN_ORDER_ID"]));
            this.ApplicationCode = Convert.ToString(CommonFunctions.ToObject(dr["APPLICATION_CODE"]));
            this.IsProductPurchase = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_PRODUCT_PURCHASE"]));
            this.PurchaseType = Convert.ToString(CommonFunctions.ToObject(dr["PURCHASE_TYPE"]));
            this.ApplicationPerson = Convert.ToString(CommonFunctions.ToObject(dr["APPLICATION_PERSON"]));
            this.ApplicationDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["APPLICATION_DATE"]));
            this.DeliveryRequiredDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["DELIVERY_REQUIRED_DATE"]));
            this.DeliveryPlanDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["DELIVERY_PLAN_DATE"]));
            this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
            this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
            this.CreatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["CREATED_DATE"]));
            this.CreatedBy = Convert.ToString(CommonFunctions.ToObject(dr["CREATED_BY"]));
            this.LastModifiedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["LAST_MODIFIED_DATE"]));
            this.LastModifiedBy = Convert.ToString(CommonFunctions.ToObject(dr["LAST_MODIFIED_BY"]));
            this.ApprovedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["APPROVED_DATE"]));
            this.ApprovedBy = Convert.ToString(CommonFunctions.ToObject(dr["APPROVED_BY"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return PurApplicationTable.Current;
            }
        }

        #region Perporty List
        public string ApplicationId
        {
            get { return Convert.ToString(GetData(PurApplicationTable.C_APPLICATION_ID)); }
            set { SetData(PurApplicationTable.C_APPLICATION_ID, value); }
        }

        public string PlanOrderId
        {
            get { return Convert.ToString(GetData(PurApplicationTable.C_PLAN_ORDER_ID)); }
            set { SetData(PurApplicationTable.C_PLAN_ORDER_ID, value); }
        }

        public string ApplicationCode
        {
            get { return Convert.ToString(GetData(PurApplicationTable.C_APPLICATION_CODE)); }
            set { SetData(PurApplicationTable.C_APPLICATION_CODE, value); }
        }

        public int IsProductPurchase
        {
            get { return Convert.ToInt32(GetData(PurApplicationTable.C_IS_PRODUCT_PURCHASE)); }
            set { SetData(PurApplicationTable.C_IS_PRODUCT_PURCHASE, value); }
        }

        public string PurchaseType
        {
            get { return Convert.ToString(GetData(PurApplicationTable.C_PURCHASE_TYPE)); }
            set { SetData(PurApplicationTable.C_PURCHASE_TYPE, value); }
        }

        public string ApplicationPerson
        {
            get { return Convert.ToString(GetData(PurApplicationTable.C_APPLICATION_PERSON)); }
            set { SetData(PurApplicationTable.C_APPLICATION_PERSON, value); }
        }

        public DateTime ApplicationDate
        {
            get { return Convert.ToDateTime(GetData(PurApplicationTable.C_APPLICATION_DATE)); }
            set { SetData(PurApplicationTable.C_APPLICATION_DATE, value); }
        }

        public DateTime DeliveryRequiredDate
        {
            get { return Convert.ToDateTime(GetData(PurApplicationTable.C_DELIVERY_REQUIRED_DATE)); }
            set { SetData(PurApplicationTable.C_DELIVERY_REQUIRED_DATE, value); }
        }

        public DateTime DeliveryPlanDate
        {
            get { return Convert.ToDateTime(GetData(PurApplicationTable.C_DELIVERY_PLAN_DATE)); }
            set { SetData(PurApplicationTable.C_DELIVERY_PLAN_DATE, value); }
        }

        public string Status
        {
            get { return Convert.ToString(GetData(PurApplicationTable.C_STATUS)); }
            set { SetData(PurApplicationTable.C_STATUS, value); }
        }

        public string Remark
        {
            get { return Convert.ToString(GetData(PurApplicationTable.C_REMARK)); }
            set { SetData(PurApplicationTable.C_REMARK, value); }
        }

        public DateTime CreatedDate
        {
            get { return Convert.ToDateTime(GetData(PurApplicationTable.C_CREATED_DATE)); }
            set { SetData(PurApplicationTable.C_CREATED_DATE, value); }
        }

        public string CreatedBy
        {
            get { return Convert.ToString(GetData(PurApplicationTable.C_CREATED_BY)); }
            set { SetData(PurApplicationTable.C_CREATED_BY, value); }
        }

        public DateTime LastModifiedDate
        {
            get { return Convert.ToDateTime(GetData(PurApplicationTable.C_LAST_MODIFIED_DATE)); }
            set { SetData(PurApplicationTable.C_LAST_MODIFIED_DATE, value); }
        }

        public string LastModifiedBy
        {
            get { return Convert.ToString(GetData(PurApplicationTable.C_LAST_MODIFIED_BY)); }
            set { SetData(PurApplicationTable.C_LAST_MODIFIED_BY, value); }
        }

        public DateTime ApprovedDate
        {
            get { return Convert.ToDateTime(GetData(PurApplicationTable.C_APPROVED_DATE)); }
            set { SetData(PurApplicationTable.C_APPROVED_DATE, value); }
        }

        public string ApprovedBy
        {
            get { return Convert.ToString(GetData(PurApplicationTable.C_APPROVED_BY)); }
            set { SetData(PurApplicationTable.C_APPROVED_BY, value); }
        }

        #endregion
    }


}

